package com.yijiankang.threaddemo.example.stableobject;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

@Slf4j
public class ImmitableTest {
    private  static final ImmutableList list  = ImmutableList.of(1,2,3);

    private static final ImmutableSet set = ImmutableSet.copyOf(list);

    private static final ImmutableMap<Integer,Integer> map = ImmutableMap.of(1,2,3,4);

    public static void main(String[] args) {
        //list.add(4);//ImmitableList 不可修改 线程安全的
       // set.add(4);//ImmutableSet 不可修改 线程安全的
        //map.put(4,5);//ImmutableMap不可修改 线程安全的

        //这三种情况 取值不影响
    }
}
